<template>
  <div>
    <indexheade></indexheade>
    <div class="w">
      <el-table
         border
        :data="rightsList"
        stripe
        
        style="width: 100%">
        <el-table-column
         type="index"
          prop="date"
          label="#"
          width="80">
        </el-table-column>
        <el-table-column  prop="authName" label="权限名称" ></el-table-column>
        <el-table-column  prop="path" label="路径" ></el-table-column>
        <el-table-column  prop="level" label="权限等级" >
          <template slot-scope="scope">
            <el-tag  v-if="scope.row.level==='0'">一级</el-tag>
            <el-tag type="success" v-if="scope.row.level==='1'">二级</el-tag>
            <el-tag type="danger"  v-if="scope.row.level==='2'">三级</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import indexheade from "../components/indexheade.vue";
export default {
name:'rights',
data() {
  return {
    rightsList: [],
  };
},
created(){
  // 发送请求
  this.getRightsList()
},
components:{
  indexheade
},
methods:{
  //发送网络请求获取权限列表
  getRightsList(){
    this.$http.get('rights/list').then(
    respose => {//正确请求时执行的代码
      console.log(respose.data.data);
      this.rightsList = respose.data.data
    },error => {},)
  }
}
}
</script>

<style>

</style>